/** 生成的文件，请勿修改 **/

import { watch } from "vue";
import { provideApolloClient, useMutation, useQuery } from "@vue/apollo-composable";
import { apolloClient } from "@/utils/apolloClient";
import { GQL } from "./api.gql";
import * as APIModel from "./api.model"
import { Utilts } from "@/utils/utilts"

/**
 * 查询相关的API 
 */
class QueryApi {
	/**
 	* 查询所有后台用户
 	*/
  findAllUsers(fileds: DotNotation<APIModel.User>[]): Promise<APIModel.User[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDALLUSERS(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Id查询后台用户
 	*/
  findUserById(id: number, 
		fileds: DotNotation<APIModel.User>[]): Promise<APIModel.User> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDUSERBYID(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {id}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Json查询后台用户List
 	*/
  findUserWhereList(jsonQuery: APIModel.SearchUserInput, 
		fileds: DotNotation<APIModel.User>[]): Promise<APIModel.User[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDUSERWHERELIST(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {jsonQuery}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Json查询后台用户One
 	*/
  findUserWhereOne(jsonQuery: APIModel.SearchUserInput, 
		fileds: DotNotation<APIModel.User>[]): Promise<APIModel.User> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDUSERWHEREONE(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {jsonQuery}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 分页查询后台用户
 	*/
  findUserPage(pageInput: APIModel.PageUserInput, 
		fileds: DotNotation<APIModel.PageUserResponse>[]): Promise<APIModel.PageUserResponse> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDUSERPAGE(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {pageInput}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }


  account(fileds: DotNotation<APIModel.User>[]): Promise<APIModel.User> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.ACCOUNT(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }


  loginUser(email: string, password: string, 
		fileds: DotNotation<APIModel.User>[]): Promise<APIModel.User> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.LOGINUSER(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {email, password}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 查询所有后台菜单
 	*/
  findAllMenus(fileds: DotNotation<APIModel.Menu>[]): Promise<APIModel.Menu[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDALLMENUS(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Id查询后台菜单
 	*/
  findMenuById(id: number, 
		fileds: DotNotation<APIModel.Menu>[]): Promise<APIModel.Menu> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDMENUBYID(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {id}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Json查询后台菜单List
 	*/
  findMenuWhereList(jsonQuery: APIModel.SearchMenuSortInput, 
		fileds: DotNotation<APIModel.Menu>[]): Promise<APIModel.Menu[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDMENUWHERELIST(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {jsonQuery}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Json查询后台菜单One
 	*/
  findMenuWhereOne(jsonQuery: APIModel.SearchMenuSortInput, 
		fileds: DotNotation<APIModel.Menu>[]): Promise<APIModel.Menu> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDMENUWHEREONE(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {jsonQuery}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 分页查询后台菜单
 	*/
  findMenuPage(pageInput: APIModel.PageMenuInput, 
		fileds: DotNotation<APIModel.PageMenuResponse>[]): Promise<APIModel.PageMenuResponse> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDMENUPAGE(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {pageInput}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 查询所有后台角色
 	*/
  findAllRoles(fileds: DotNotation<APIModel.Role>[]): Promise<APIModel.Role[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDALLROLES(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Id查询后台角色
 	*/
  findRoleById(id: number, 
		fileds: DotNotation<APIModel.Role>[]): Promise<APIModel.Role> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDROLEBYID(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {id}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Json查询后台角色List
 	*/
  findRoleWhereList(jsonQuery: APIModel.SearchRoleSortInput, 
		fileds: DotNotation<APIModel.Role>[]): Promise<APIModel.Role[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDROLEWHERELIST(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {jsonQuery}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Json查询后台角色One
 	*/
  findRoleWhereOne(jsonQuery: APIModel.SearchRoleSortInput, 
		fileds: DotNotation<APIModel.Role>[]): Promise<APIModel.Role> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDROLEWHEREONE(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {jsonQuery}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 分页查询后台角色
 	*/
  findRolePage(pageInput: APIModel.PageRoleInput, 
		fileds: DotNotation<APIModel.PageRoleResponse>[]): Promise<APIModel.PageRoleResponse> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDROLEPAGE(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {pageInput}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 查询所有后台权限
 	*/
  findAllPowers(fileds: DotNotation<APIModel.Power>[]): Promise<APIModel.Power[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDALLPOWERS(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Id查询后台权限
 	*/
  findPowerById(id: number, 
		fileds: DotNotation<APIModel.Power>[]): Promise<APIModel.Power> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDPOWERBYID(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {id}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Json查询后台权限List
 	*/
  findPowerWhereList(jsonQuery: APIModel.SearchPowerSortInput, 
		fileds: DotNotation<APIModel.Power>[]): Promise<APIModel.Power[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDPOWERWHERELIST(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {jsonQuery}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Json查询后台权限One
 	*/
  findPowerWhereOne(jsonQuery: APIModel.SearchPowerSortInput, 
		fileds: DotNotation<APIModel.Power>[]): Promise<APIModel.Power> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDPOWERWHEREONE(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {jsonQuery}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 分页查询后台权限
 	*/
  findPowerPage(pageInput: APIModel.PagePowerInput, 
		fileds: DotNotation<APIModel.PagePowerResponse>[]): Promise<APIModel.PagePowerResponse> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDPOWERPAGE(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {pageInput}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 查询所有游戏活动
 	*/
  findAllActivitys(fileds: DotNotation<APIModel.Activity>[]): Promise<APIModel.Activity[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDALLACTIVITYS(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Id查询游戏活动
 	*/
  findActivityById(id: number, 
		fileds: DotNotation<APIModel.Activity>[]): Promise<APIModel.Activity> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDACTIVITYBYID(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {id}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Json查询游戏活动List
 	*/
  findActivityWhereList(jsonQuery: APIModel.SearchActivityInput, 
		fileds: DotNotation<APIModel.Activity>[]): Promise<APIModel.Activity[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDACTIVITYWHERELIST(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {jsonQuery}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 根据Json查询游戏活动One
 	*/
  findActivityWhereOne(jsonQuery: APIModel.SearchActivityInput, 
		fileds: DotNotation<APIModel.Activity>[]): Promise<APIModel.Activity> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDACTIVITYWHEREONE(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {jsonQuery}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

	/**
 	* 分页查询游戏活动
 	*/
  findActivityPage(pageInput: APIModel.PageActivityInput, 
		fileds: DotNotation<APIModel.PageActivityResponse>[]): Promise<APIModel.PageActivityResponse> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.FINDACTIVITYPAGE(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {pageInput}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }


  playerModelDatas(fileds: DotNotation<APIModel.PlayerModelData>[]): Promise<APIModel.PlayerModelData[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.PLAYERMODELDATAS(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }


  playerModelData(id: number, 
		fileds: DotNotation<APIModel.PlayerModelData>[]): Promise<APIModel.PlayerModelData> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.PLAYERMODELDATA(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {id}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }


  roleModelDatas(fileds: DotNotation<APIModel.RoleModelData>[]): Promise<APIModel.RoleModelData[]> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.ROLEMODELDATAS(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }


  roleModelData(id: number, 
		fileds: DotNotation<APIModel.RoleModelData>[]): Promise<APIModel.RoleModelData> {
    return new Promise((resolve, reject) => {
      const fildesStr = Utilts.ins().generateFieldString(fileds)
      const code = GQL.Query.ROLEMODELDATA(fildesStr)
      const { result, loading } = provideApolloClient(apolloClient)(() =>
        useQuery(code, {id}, {
          fetchPolicy: 'cache-and-network',
        }))
			watch(loading, (val) => {	
				if (!val && result.value) {
					resolve(result?.value?.dataSource);
				} else {
					reject(null);
			}})
    });
  }

}


/**
 * 变更相关的API 
 */
class MutationApi {
	/**
 	* 创建用户
 	*/
  createUser(createUserInput: APIModel.CreateUserInput, 
		fileds: DotNotation<APIModel.User>[]): Promise<APIModel.User> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.CREATEUSER(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({createUserInput});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 修改后台用户
 	*/
  updateUser(id: number, updateUserInput: APIModel.UpdateUserInput, 
		fileds: DotNotation<APIModel.User>[]): Promise<APIModel.User> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.UPDATEUSER(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id, updateUserInput});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 软删除后台用户
 	*/
  softDeleteUser(id: number, 
		fileds: DotNotation<APIModel.User>[]): Promise<APIModel.User> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.SOFTDELETEUSER(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 真删除后台用户
 	*/
  hardDeleteUser(id: number, 
		fileds: DotNotation<APIModel.User>[]): Promise<APIModel.User> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.HARDDELETEUSER(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }


  updateUserPwd(updateUserPwd: APIModel.UpdatePasswordInput, 
		fileds: DotNotation<APIModel.User>[]): Promise<APIModel.User> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.UPDATEUSERPWD(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({updateUserPwd});
      resolve(result?.data?.dataSource);
    });
  }


  login(loginUserInput: APIModel.LoginUserInput, 
		fileds: DotNotation<APIModel.LoginUserResponse>[]): Promise<APIModel.LoginUserResponse> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.LOGIN(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({loginUserInput});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 创建后台菜单
 	*/
  createMenu(createMenuInput: APIModel.CreateMenuInput, 
		fileds: DotNotation<APIModel.Menu>[]): Promise<APIModel.Menu> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.CREATEMENU(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({createMenuInput});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 修改后台菜单
 	*/
  updateMenu(id: number, updateMenuInput: APIModel.UpdateMenuInput, 
		fileds: DotNotation<APIModel.Menu>[]): Promise<APIModel.Menu> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.UPDATEMENU(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id, updateMenuInput});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 软删除后台菜单
 	*/
  softDeleteMenu(id: number, 
		fileds: DotNotation<APIModel.Menu>[]): Promise<APIModel.Menu> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.SOFTDELETEMENU(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 真删除后台菜单
 	*/
  hardDeleteMenu(id: number, 
		fileds: DotNotation<APIModel.Menu>[]): Promise<APIModel.Menu> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.HARDDELETEMENU(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 创建后台角色
 	*/
  createRole(createRoleInput: APIModel.CreateRoleInput, 
		fileds: DotNotation<APIModel.Role>[]): Promise<APIModel.Role> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.CREATEROLE(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({createRoleInput});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 修改后台角色
 	*/
  updateRole(id: number, updateRoleInput: APIModel.UpdateRoleInput, 
		fileds: DotNotation<APIModel.Role>[]): Promise<APIModel.Role> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.UPDATEROLE(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id, updateRoleInput});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 软删除后台角色
 	*/
  softDeleteRole(id: number, 
		fileds: DotNotation<APIModel.Role>[]): Promise<APIModel.Role> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.SOFTDELETEROLE(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 真删除后台角色
 	*/
  hardDeleteRole(id: number, 
		fileds: DotNotation<APIModel.Role>[]): Promise<APIModel.Role> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.HARDDELETEROLE(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 创建后台权限
 	*/
  createPower(createPowerInput: APIModel.CreatePowerInput, 
		fileds: DotNotation<APIModel.Power>[]): Promise<APIModel.Power> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.CREATEPOWER(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({createPowerInput});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 修改后台权限
 	*/
  updatePower(id: number, updatePowerInput: APIModel.UpdatePowerInput, 
		fileds: DotNotation<APIModel.Power>[]): Promise<APIModel.Power> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.UPDATEPOWER(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id, updatePowerInput});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 软删除后台权限
 	*/
  softDeletePower(id: number, 
		fileds: DotNotation<APIModel.Power>[]): Promise<APIModel.Power> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.SOFTDELETEPOWER(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 真删除后台权限
 	*/
  hardDeletePower(id: number, 
		fileds: DotNotation<APIModel.Power>[]): Promise<APIModel.Power> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.HARDDELETEPOWER(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 创建游戏活动
 	*/
  createActivity(createActivityInput: APIModel.CreateActivityInput, 
		fileds: DotNotation<APIModel.Activity>[]): Promise<APIModel.Activity> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.CREATEACTIVITY(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({createActivityInput});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 修改游戏活动
 	*/
  updateActivity(id: number, updateActivityInput: APIModel.UpdateActivityInput, 
		fileds: DotNotation<APIModel.Activity>[]): Promise<APIModel.Activity> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.UPDATEACTIVITY(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id, updateActivityInput});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 软删除游戏活动
 	*/
  softDeleteActivity(id: number, 
		fileds: DotNotation<APIModel.Activity>[]): Promise<APIModel.Activity> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.SOFTDELETEACTIVITY(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }

	/**
 	* 真删除游戏活动
 	*/
  hardDeleteActivity(id: number, 
		fileds: DotNotation<APIModel.Activity>[]): Promise<APIModel.Activity> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.HARDDELETEACTIVITY(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }


  removePlayerModelDatum(id: number, 
		fileds: DotNotation<APIModel.PlayerModelData>[]): Promise<APIModel.PlayerModelData> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.REMOVEPLAYERMODELDATUM(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }


  removeRoleModelDatum(id: number, 
		fileds: DotNotation<APIModel.RoleModelData>[]): Promise<APIModel.RoleModelData> {
    return new Promise(async (resolve, reject) => {
       var fildesStr = Utilts.ins().generateFieldString(fileds)
       var code = GQL.Mutation.REMOVEROLEMODELDATUM(fildesStr)
      const { mutate: send } = provideApolloClient(apolloClient)(() => useMutation(code));
      const result = await send({id});
      resolve(result?.data?.dataSource);
    });
  }

}


/** 查询，变更API **/
export const API = {
	Query: new QueryApi(),
	Mutation: new MutationApi(),
}